﻿using Server.Manager;
using Server.Protocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace Server.Net
{
    class NetSetting
    {
        public bool IsEmpty { get; set; }
        public IPEndPoint Address { get; set; }

        public int MaxConnect { get; set; }

        public int ListenCount { get; set; }

        public int BufferSize { get; set; }

        public ProtocolParser Parser { get; set; }

        public long HeartIntervalTicks { get; set; }

        public static NetSetting Default { 
            get
            {
                NetSetting setting = new NetSetting();
                setting.IsEmpty = false;
                setting.Address = new IPEndPoint(IPAddress.Any, 12345);
                setting.MaxConnect = 500;
                setting.ListenCount = 50;
                setting.BufferSize = 1024;
                setting.HeartIntervalTicks = TimeSystem.GetTicks(3000);
                setting.Parser = ProtocolParser.GetUTF8Parser();
                return setting;
            } 
        }

        public NetSetting()
        {

        }
    }
}
